package com.changgou.user.feign;

import com.changgou.common.pojo.Result;
import com.changgou.user.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "user")
@RequestMapping("/user")
public interface UserFeign {
    /**
     * 用户登录服务的调用
     * @return
     */
    @GetMapping("/load/{username}")
     Result<User>  findById(@RequestParam String username);

    /**
     * 添加用户积分
     * @param points
     * @return
     */
    @GetMapping(value = "/points/add")
    Result addPoints(@RequestParam Integer points);
}
